package thread;

import rabbitmq.model.User;

import java.util.concurrent.Callable;

/**
 * @author hubert
 * @date 2018/4/19
 * @description TaskUtil
 */
public class TaskUtil implements Callable {

	private User user;

	public boolean process() {
		System.out.println(user.getId()+";"+user.getName());
		try {
			Thread.sleep(5000L);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		return true;
	}

	public TaskUtil(User user) {
		this.user = user;
	}

	@Override
	public Object call() throws Exception {
		return process();
	}
}
